import { createRouter, createWebHistory } from 'vue-router';
import App from '../App.vue';
import Chat from '../Chat.vue';

const routes = [
    {
        path: '/',
        name: 'App',
        component: App
    },
    {
        path: '/chat',
        name: 'Chat',
        component: Chat,
        props: route => ({ id: route.query.id })
    }
];

// 创建路由实例
const router = createRouter({
    history: createWebHistory(),
    routes
});


export default router;